Skip to content

feat: add a dummy swift file to the example if the library uses swift - #525

Closed
mfazekas wants to merge 1 commit into
callstack:mainfrom
mfazekas:ios-example-swift-file
Closed

feat: add a dummy swift file to the example if the library uses swift#525
mfazekas wants to merge 1 commit into
callstack:mainfrom
mfazekas:ios-example-swift-file

Conversation

@mfazekas

@mfazekas mfazekas commented Feb 4, 2024

Copy link
Copy Markdown

Summary

It seems that swift debugging in libraries doesn't really work unless the app itself has a swift file. See #517

There is an empty File.swift in example-legacy template but it's not added to the project. This change executes a ruby script to include that file in the Xcode project.

Note that it requires working ruby install and xcodeproj gem available and only run on Mac. Which is reasonable as , ruby and xcodeproj are decencies of cocoa pods.

Test plan

@atlj

atlj commented May 24, 2024

Copy link
Copy Markdown
Collaborator

Hey @mfazekas thanks a lot for the PR! I was able to validate the issue on my end.
I have one question regarding the implementation, do you think it would make sense to use the @bacons/xcode to create the swift file instead of using ruby here? Yes we already have the necessary dependencies to run a ruby script here but most of the logic is already inside NodeJS I think directly using NodeJS instead of spawning ruby would make more sense since:

  1. So far we've been using ~99% Javascript
  2. Most of the contributors are familiar with Javascript
  3. We have tools to statically check the Javascript code in this repo but not Ruby.
  4. Non-MacOS systems would be able to create the file (This one still needs to be tested). So users can start their library in a non-darwin platform and then move to darwin. This might prevent an edge case.
  5. We would like to add similar logic to modify the generated XCode project further, so this would be a great first step.

You can find the exact same implementation done in @bacons/xcode here.
Screenshot 2024-05-24 at 21 51 06

@mfazekas

Copy link
Copy Markdown
Author

@atlj sure we can do it in javascript I was not aware of '@bacons/Xcode'; . Cocoapods does use ruby and xcodeproj gem, so it should be installed, but I agree that js solution is better.

@satya164
satya164 force-pushed the main branch 2 times, most recently from 9ca6093 to 72a579c Compare March 27, 2025 16:42
@satya164
satya164 force-pushed the main branch 6 times, most recently from 0b45375 to 7799977 Compare April 7, 2025 20:23
@mfazekas

mfazekas commented Sep 5, 2025

Copy link
Copy Markdown
Author

AppDelegate is now a swift file so this is pointless

@mfazekas mfazekas closed this Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants